package com.dianping.cat.home.exception.entity;

import com.dianping.cat.home.exception.BaseEntity;
import com.dianping.cat.home.exception.IVisitor;
import java.util.LinkedHashMap;
import java.util.Map;

public class ExceptionRuleConfig
  extends BaseEntity<ExceptionRuleConfig> {
/*  10 */   private Map<String, ExceptionLimit> m_exceptionLimits = new LinkedHashMap();

/*  12 */   private Map<String, ExceptionExclude> m_exceptionExcludes = new LinkedHashMap();






/*  19 */   public void accept(IVisitor visitor) { visitor.visitExceptionRuleConfig(this); }


  public ExceptionRuleConfig addExceptionExclude(ExceptionExclude exceptionExclude) {
/*  23 */     this.m_exceptionExcludes.put(exceptionExclude.getId(), exceptionExclude);
    return this;
  }

  public ExceptionRuleConfig addExceptionLimit(ExceptionLimit exceptionLimit) {
/*  28 */     this.m_exceptionLimits.put(exceptionLimit.getId(), exceptionLimit);
    return this;
  }


  public boolean equals(Object obj) {
/*  34 */     if (obj instanceof ExceptionRuleConfig) {
/*  35 */       ExceptionRuleConfig _o = (ExceptionRuleConfig)obj;

/*  37 */       if (!equals(getExceptionLimits(), _o.getExceptionLimits())) {
/*  38 */         return false;
      }

/*  41 */       if (!equals(getExceptionExcludes(), _o.getExceptionExcludes())) {
/*  42 */         return false;
      }


/*  46 */       return true;
    }

/*  49 */     return false;
  }


/*  53 */   public ExceptionExclude findExceptionExclude(String id) { return (ExceptionExclude)this.m_exceptionExcludes.get(id); }



/*  57 */   public ExceptionLimit findExceptionLimit(String id) { return (ExceptionLimit)this.m_exceptionLimits.get(id); }


  public ExceptionExclude findOrCreateExceptionExclude(String id) {
/*  61 */     ExceptionExclude exceptionExclude = (ExceptionExclude)this.m_exceptionExcludes.get(id);

/*  63 */     if (exceptionExclude == null) {
/*  64 */       synchronized (this.m_exceptionExcludes) {
/*  65 */         exceptionExclude = (ExceptionExclude)this.m_exceptionExcludes.get(id);

/*  67 */         if (exceptionExclude == null) {
/*  68 */           exceptionExclude = new ExceptionExclude(id);
/*  69 */           this.m_exceptionExcludes.put(id, exceptionExclude);
        }
      }
    }

/*  74 */     return exceptionExclude;
  }

  public ExceptionLimit findOrCreateExceptionLimit(String id) {
    ExceptionLimit exceptionLimit = (ExceptionLimit)this.m_exceptionLimits.get(id);

/*  80 */     if (exceptionLimit == null) {
/*  81 */       synchronized (this.m_exceptionLimits) {
/*  82 */         exceptionLimit = (ExceptionLimit)this.m_exceptionLimits.get(id);

/*  84 */         if (exceptionLimit == null) {
/*  85 */           exceptionLimit = new ExceptionLimit(id);
/*  86 */           this.m_exceptionLimits.put(id, exceptionLimit);
        }
      }
    }

/*  91 */     return exceptionLimit;
  }


  public Map<String, ExceptionExclude> getExceptionExcludes() { return this.m_exceptionExcludes; }



/*  99 */   public Map<String, ExceptionLimit> getExceptionLimits() { return this.m_exceptionLimits; }



  public int hashCode() {
/* 104 */     int hash = 0;

/* 106 */     hash = hash * 31 + ((this.m_exceptionLimits == null) ? 0 : this.m_exceptionLimits.hashCode());
/* 107 */     return hash * 31 + ((this.m_exceptionExcludes == null) ? 0 : this.m_exceptionExcludes.hashCode());
  }




  public void mergeAttributes(ExceptionRuleConfig other) {}



/* 117 */   public ExceptionExclude removeExceptionExclude(String id) { return (ExceptionExclude)this.m_exceptionExcludes.remove(id); }



/* 121 */   public ExceptionLimit removeExceptionLimit(String id) { return (ExceptionLimit)this.m_exceptionLimits.remove(id); }
}


/* Location:              /Users/hanfei/Documents/apache-tomcat-9.0.24/webapps/cat/WEB-INF/classes/!/com/dianping/cat/home/exception/entity/ExceptionRuleConfig.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.0.7
 */